-
Notifications
You must be signed in to change notification settings - Fork 64
feat: add netkit support #185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6c00e9f to
b5253a0
Compare
cathay4t
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Small changes required.
src/link/link_info/netkit.rs
Outdated
| } | ||
|
|
||
| const NETKIT_POLICY_PASS: u32 = 0; | ||
| const NETKIT_POLICY_DROP: u32 = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use kernel constant name for the seek of developer to search in linux kernel.
And also , you missed NETKIT_REDIRECT
NETKIT_PASS = 0,
NETKIT_DROP = 2,
NETKIT_REDIRECT = 7,There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - must have only looked at the initial implementation diff. Missed a bunch here, thanks!
| const IFLA_NETKIT_PRIMARY: u16 = 2; | ||
| const IFLA_NETKIT_POLICY: u16 = 3; | ||
| const IFLA_NETKIT_PEER_POLICY: u16 = 4; | ||
| const IFLA_NETKIT_MODE: u16 = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing:
IFLA_NETKIT_SCRUB,
IFLA_NETKIT_PEER_SCRUB,
IFLA_NETKIT_HEADROOM,
IFLA_NETKIT_TAILROOM,It's OK to skip them for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add in e14bcc2.
Happy to drop that commit if we prefer to not support it for now.
This PR adds support for netkit devices
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=22360fad5889cbefe1eca695b0cc0273ab280b56